package jdk8demo.interfacefunction;

import java.util.Comparator;
import java.util.Optional;

public class ComparatorOptionalDemo {

	public static void main(String[] args) {
		Comparator<Integer> com = (a, b) -> a > b ? 1 : 0;
		System.out.println(com.compare(2, 1));

		Integer i1 = null;
		Integer i2 = 2;

		System.out.println(Optional.ofNullable(i1).orElse(0).intValue());
		System.out.println(Optional.ofNullable(i2).orElse(0).intValue());
	}
}
